home *** CD-ROM | disk | FTP | other *** search
- /* Read netmail messages addressed to me, and print them. */
-
- #include <stdio.h>
- #include <conio.h>
- #include <stdlib.h>
- #include <string.h>
- #include "mb_lib.h"
-
- int putln (char *); /* proto */
-
- void main () {
- M_TEXT msgtxt;
- NET_RECORD nethdr;
- char msgpath [MAXPATH];
- int msgnr;
-
- strcpy (msgpath, "C:\\MSGBASE");
- clrscr ();
- msgnr = net_first (msgpath); /* Find netmail to me */
- while (msgnr != -1) {
- net_read_hdr (msgpath, msgnr, & nethdr); /* Read header */
- msgtxt = net_read_text (msgpath, msgnr); /* Read text */
- printf ("By: %s\n", nethdr.who_from); /* Print header */
- printf ("To: %s\n", nethdr.who_to);
- printf ("Re: %s\n", nethdr.subject);
- puts ("-----------------------------------------------");
- txt_dump (msgtxt, putln, 70, 0); /* Print text, using */
- puts ("<End of message>\n\n\n"); /* 70 cols, no kludges */
- msgnr = net_next (msgpath, msgnr);
- }
- }
-
- int putln (char * line) { /* This one does the actual printing */
- puts (line);
- return (0);
- }